package sk.hackcraft.util.generator.empirical;

import sk.hackcraft.util.generator.UniformDiscreteRandom;

public class UniformDiscreteBuilderItem extends AbstractBuilderItem
{
	private final int minValue;
	private final int maxValue;

	public UniformDiscreteBuilderItem(double probability, int minValue, int maxValue)
	{
		super(probability);
		this.minValue = minValue;
		this.maxValue = maxValue;
	}

	@Override
	public EmpiricalItemCreatorDelegate getEmpiricalItemCreatorDelegate()
	{
		return new EmpiricalItemCreatorDelegate()
		{
			@Override
			public EmpiricalItem createEmpiricalItem(double cumulativeValue)
			{
				return new EmpiricalItem(cumulativeValue, new UniformDiscreteRandom(minValue, maxValue));
			}
		};
	}
}
